package com.eobard.utils;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: Eobard Gu
 * @Date: 2025-07-18
 * @Description: TODO
 */
@Component
public class SecKillUtils {

    //TODO:可考虑使用redis或者DB记录秒杀状态
    //记录秒杀状态
    private Map<String, String> secKillStatus = new HashMap<>();

    public String getSecKillStatus(String secKillId) {
        return secKillStatus.get(secKillId);// 获取秒杀状态
    }

    public void updateSecKillStatus(String secKillId, String status) {
        secKillStatus.put(secKillId, status);                              // 更新秒杀状态
    }

}
